import request from '@/utils/request'

// 1.获取员工列表
export const getEmployees = function(data) {
  return request.get('/sys/user', { params: data })
}

// 2.根据ID - 删除对应的数据
export const deleteEmployees = function(id) {
  return request.delete('/sys/user/' + id)
}

// 3.添加员工
export const addEmployees = function(data) {
  return request.post('/sys/user', data)
}

// 4.实现excel导入-封装接口并调用
export const importEmployee = function(data) {
  return request.post('/sys/user/batch', data)
}

// employees页面点查看跳入userinfo页面
export const getUserDetailById = function(id) {
  return request.get('/sys/user/' + id)
}

// 保存更新
export const updataEmployees = function(data) {
  return request.put('/sys/user/' + data.id, data)
}
